USE [Training]
GO

IF NOT EXISTS (SELECT * from dbo.sysobjects WHERE id = OBJECT_ID(N'dbo.training_api_DepartmentInsert'))
	EXEC('CREATE PROC dbo.training_api_DepartmentInsert AS')
GO

ALTER PROC dbo.training_api_DepartmentInsert
	@Title	nvarchar(200),
	@DepartmentID	int	output
AS
	INSERT INTO Department(
		Title)
	VALUES(
		@Title)
	SELECT @DepartmentID = SCOPE_IDENTITY()
